import request from '@/config/request'
import { dictApi } from './api'

/**
 * @description 查询字典
 * @export
 * @param {dictData} [data={}]
 * @param {*} [config={}]
 * @return {*}
 */
export const getDictList = (data = {}, config = {}) => {
  return request({
    url: `${dictApi}/list`,
    method: 'get',
    params: {
      cat: data.cat || '',
      cat_route: data.cat_route || '',
      id: data.id || '',
      with_children: data.with_children || true,
      with_defunct: data.with_defunct || true
    },
    ...config
  })
}
